package com.ace.model.bo;

/***********************************************************************
 * Module:  Contrat.java
 * Author:  a.kanwar
 * Purpose: Defines the Class Contrat
 ***********************************************************************/

import java.util.*;


public class Contrat {
   
   /************************************************************************
    * attribute
    ************************************************************************/ 
    
   private int idContrat;
   private java.lang.String numContrat;
   private java.util.Date dateDebutContrat;
   private java.util.Date dateFinContrat;
   
   private Assure assure;
   private RefPrix refPrix;

    public Contrat(int idContrat, String numContrat, Date dateDebutContrat, Date dateFinContrat, Assure assure, RefPrix refPrix) {
        this.idContrat = idContrat;
        this.numContrat = numContrat;
        this.dateDebutContrat = dateDebutContrat;
        this.dateFinContrat = dateFinContrat;
        this.assure = assure;
        this.refPrix = refPrix;
    }

    public Contrat(String numContrat, Date dateDebutContrat, Date dateFinContrat, Assure assure, RefPrix refPrix) {
        this.numContrat = numContrat;
        this.dateDebutContrat = dateDebutContrat;
        this.dateFinContrat = dateFinContrat;
        this.assure = assure;
        this.refPrix = refPrix;
    }

    /**************************************************************************
     * 
     * getter and setter 
     **************************************************************************/
    public int getIdContrat() {
        return idContrat;
    }

    public void setIdContrat(int idContrat) {
        this.idContrat = idContrat;
    }

    public String getNumContrat() {
        return numContrat;
    }

    public void setNumContrat(String numContrat) {
        this.numContrat = numContrat;
    }

    public Date getDateDebutContrat() {
        return dateDebutContrat;
    }

    public void setDateDebutContrat(Date dateDebutContrat) {
        this.dateDebutContrat = dateDebutContrat;
    }

    public Date getDateFinContrat() {
        return dateFinContrat;
    }

    public void setDateFinContrat(Date dateFinContrat) {
        this.dateFinContrat = dateFinContrat;
    }

    @Override
    public String toString() {
        return "Contrat{" + "idContrat=" + idContrat + ", numContrat=" + numContrat + ", dateDebutContrat=" + dateDebutContrat + ", dateFinContrat=" + dateFinContrat + ", assure=" + assure + ", refPrix=" + refPrix + '}';
    }
   
   
    
    
    
    
    
    
    
    
    /***********************************************************************
     * generate code by power AMC
     ************************************************************************/
    
    
   /** @pdGenerated default parent getter */
   public Assure getAssure() {
      return assure;
   }
   
   /** @pdGenerated default parent setter
     * @param newAssure */
   public void setAssure(Assure newAssure) {
      if (this.assure == null || !this.assure.equals(newAssure))
      {
         if (this.assure != null)
         {
            Assure oldAssure = this.assure;
            this.assure = null;
            oldAssure.removeContrat(this);
         }
         if (newAssure != null)
         {
            this.assure = newAssure;
            this.assure.addContrat(this);
         }
      }
   }
   /** @pdGenerated default parent getter */
   public RefPrix getRefPrix() {
      return refPrix;
   }
   
   /** @pdGenerated default parent setter
     * @param newRefPrix */
   public void setRefPrix(RefPrix newRefPrix) {
      if (this.refPrix == null || !this.refPrix.equals(newRefPrix))
      {
         if (this.refPrix != null)
         {
            RefPrix oldRefPrix = this.refPrix;
            this.refPrix = null;
            oldRefPrix.removeContrat(this);
         }
         if (newRefPrix != null)
         {
            this.refPrix = newRefPrix;
            this.refPrix.addContrat(this);
         }
      }
   }

}